<!DOCTYPE>
<html>
<head>
  <load file="__PUBLIC__/Css/layout.css" />
  <load file="__PUBLIC__/Js/jquery.js" />
  <load file="__PUBLIC__/Js/main.js" />
  <load file="__PUBLIC__/Js/jquery-ui.min.js" />
  <load file="__PUBLIC__/Js/yanue.pop.js" />
 
</head>
<body>
  <div class="OA_main">
     <div class="OA_welcom_left"></div>
	 <iframe src="__APP__/Public/main_info" frameborder="no" style="height:auto;width:95%;
height:82px;float:left;overflow:hidden;" target="main"></iframe>
     <div class="OA_welcom_right"></div>
     
     <div class="OA_main_content">
        <div class="OA_main_left">
            <!--公告通知版块开始-->
            <if condition="$user_info[0]['u_window'] eq '1'">
            <div class="OA_main_L1 S_1" style="left:<{$ab_info[0]['a_left']}>px;top:<{$ab_info[0]['a_top']}>px;z-index:<{$ab_info[0]['a_zIndex']}>">
                <h1>公告通知</h1>
                <ul>
                <if condition="$n eq '2'">
                <span style="font-size:15px;color:red;">对不起,暂无公告通知...</span>        
                </if>
                   <volist name="n_info" id="v">  
                   	<li><{$v.n_title}><span style="float:right;"><{$v.n_addtime|date="Y-m-d",###}>&nbsp;&nbsp;<i><{$v.n_department}>发布</i></span></li>
                   </volist>
                </ul>
            </div>
            <else />
            <div class="OA_main_L1 S_1">
                <h1>公告通知</h1>
                <ul>
                <if condition="$n eq '2'">
                <span style="font-size:15px;color:red;">对不起,暂无公告通知...</span>        
                </if>
                   <volist name="n_info" id="v">  
                   	<li><{$v.n_title}><span style="float:right;"><{$v.n_addtime|date="Y-m-d",###}>&nbsp;&nbsp;<i><{$v.n_department}>发布</i></span></li>
                   </volist>
                </ul>
            </div>
            </if>
            <!--公告通知版块结束-->
            <!--公共交流版块开始-->
            <if condition="$user_info[0]['u_window'] eq '1'">
            <div class="OA_main_L2 S_2" style="left:<{$ab_info[1]['a_left']}>px;top:<{$ab_info[1]['a_top']}>px;z-index:<{$ab_info[1]['a_zIndex']}>">
                <h1>公共交流频道<span style="float:right;margin-right:5px;"><a href="__APP__/ChatChannel/publicChannel" style="font-size:12px;color:red">【进入交流室】</a></span></h1>
                <ul>
                <if condition="$c eq '2'">
                <span style="font-size:15px;color:red;">对不起,暂无交流记录...</span>        
                </if>
                  <volist name="c_info" id="v">  
                   	<li><{$v.c_msg|substr=0,30}>...<span style="float:left;">>>&nbsp;<{$v.c_time|date="Y-m-d H:m",###}>&nbsp;&nbsp;<i><{$v.c_user}>&nbsp;:&nbsp;</i></span></li>
                   </volist>
                </ul>
            </div>
            <else />
            <div class="OA_main_L2 S_2">
                <h1>公共交流频道<span style="float:right;margin-right:5px;"><a href="__APP__/ChatChannel/publicChannel" style="font-size:12px;color:red">【进入交流室】</a></span></h1>
                <ul>
                <if condition="$c eq '2'">
                <span style="font-size:15px;color:red;">对不起,暂无交流记录...</span>        
                </if>
                  <volist name="c_info" id="v">  
                   	<li><{$v.c_msg|substr=0,30}>...<span style="float:left;">>>&nbsp;<{$v.c_time|date="Y-m-d H:m",###}>&nbsp;&nbsp;<i><{$v.c_user}>&nbsp;:&nbsp;</i></span></li>
                   </volist>
                </ul>
            </div>
            </if>
            <!--公共交流版块结束-->
        </div>    
        <!--备忘录版块开始-->
        <if condition="$user_info[0]['u_window'] eq '1'">
        <div class="OA_main_content S_3" style="left:<{$ab_info[2]['a_left']}>px;top:<{$ab_info[2]['a_top']}>px;z-index:<{$ab_info[2]['a_zIndex']}>">
            <div class="OA_main_C1">
               <span><img src="__PUBLIC__/Images/OA_main14.jpg" /></span>
               <span class="OA_main_C1_span">
                  <button class="button_1"></button>
                  <b id="time_info"><{$now_time|date="Y-m",###}></b>
                  <button class="button_2"></button>
               </span>
            </div>
            <ul class="OA_main_C2">
               <!--<for start="1" end="31">
                  <li><a href="#"><{$i}></a></li>
               </for>-->
            </ul> 
            <div class="OA_main_C3">
               <span id="d_click" style="cursor:pointer;">当天</span>
               <p id="memo_msg">内容...</p>
            </div>
            <div class="OA_main_C4">
               <span>添加新备忘:</span><br/>
               <textarea id="memo_value"></textarea>
            </div>
            <div class="OA_main_C5">
               <input type="image" src="__PUBLIC__/Images/OA_main19.jpg" id="add_memo" />
            </div>
        </div>
        <else />
        <div class="OA_main_content S_3">
            <div class="OA_main_C1">
               <span><img src="__PUBLIC__/Images/OA_main14.jpg" /></span>
               <span class="OA_main_C1_span">
                  <button class="button_1"></button>
                  <b id="time_info"><{$now_time|date="Y-m",###}></b>
                  <button class="button_2"></button>
               </span>
            </div>
            <ul class="OA_main_C2">
               <!--<for start="1" end="31">
                  <li><a href="#"><{$i}></a></li>
               </for>-->
            </ul> 
            <div class="OA_main_C3">
               <span id="d_click" style="cursor:pointer;">当天</span>
               <p id="memo_msg">内容...</p>
            </div>
            <div class="OA_main_C4">
               <span>添加新备忘:</span><br/>
               <textarea id="memo_value"></textarea>
            </div>
            <div class="OA_main_C5">
               <input type="image" src="__PUBLIC__/Images/OA_main19.jpg" id="add_memo" />
            </div>
        </div>
        </if>
        <!--备忘录版块结束-->
  
        <div class="OA_main_right">
            <!--投票中心版块开始-->
            <if condition="$user_info[0]['u_window'] eq '1'">
            <div class="OA_main_TouPiao S_4"  style="left:<{$ab_info[3]['a_left']}>px;top:<{$ab_info[3]['a_top']}>px;z-index:<{$ab_info[3]['a_zIndex']}>">
                <h1>投票中心<span style="float:right;margin-right:5px;"><a href="#" style="font-size:12px;color:red">【查看更多】</a></span></h1>
                <ul>
                  <volist name="v_info" id="v">
                <li style='height:40px;margin-top:5px;'><a href="__APP__/Vote/user_vote">★【快来参与】<{$v.v_title}></a><p style="color:#999">开始时间:<{$v.v_starttime|date="Y-m-d",###}>&nbsp;&nbsp;结束时间:<{$v.v_endtime|date="Y-m-d",###}></p></li>
                </volist>
                </ul>
            </div>
            <else />
            <div class="OA_main_TouPiao S_4">
                <h1>投票中心<span style="float:right;margin-right:5px;"><a href="#" style="font-size:12px;color:red">【查看更多】</a></span></h1>
                <ul>
                <volist name="v_info" id="v">
                <li style='height:40px;margin-top:5px;'><a href="__APP__/Vote/user_vote">★【快来参与】<{$v.v_title}></a><p style="color:#999">开始时间:<{$v.v_starttime|date="Y-m-d",###}>&nbsp;&nbsp;结束时间:<{$v.v_endtime|date="Y-m-d",###}></p></li>
                </volist>
                </ul>
            </div>
            </if>
            <!--投票版块结束-->
            <!--话题交流版块开始-->
           <!--  <if condition="$user_info[0]['u_window'] eq '1'">
            <div class="OA_main_HuaTi S_5" style="left:<{$ab_info[4]['a_left']}>px;top:<{$ab_info[4]['a_top']}>px;z-index:<{$ab_info[4]['a_zIndex']}>">
               <h1>话题交流<span style="float:right;margin-right:5px;"><a href="#" style="font-size:12px;color:red">【查看更多】</a></span></h1>
               <ul>
                 2.0后期版本加入...暂未开放...
               </ul>
            </div>
            <else />
            <div class="OA_main_HuaTi S_5">
               <h1>话题交流<span style="float:right;margin-right:5px;"><a href="#" style="font-size:12px;color:red">【查看更多】</a></span></h1>
               <ul>
                 2.0后期版本加入...暂未开放...
               </ul>
            </div>
            </if> -->
            <!--话题交流版块结束-->
        </div>
     </div>
     
     <!--网站地图版块开始-->
     <if condition="$user_info[0]['u_window'] eq '1'">
     <div class="OA_main_map S_6"  style="left:<{$ab_info[5]['a_left']}>px;top:<{$ab_info[5]['a_top']}>px;z-index:<{$ab_info[5]['a_zIndex']}>">
        <div class="OA_main_mapTop1"></div> 
        <div class="OA_main_mapTop2">
           <ul>
             <li><span>工作日志</span><em></em></li>
             <li><span>个人文件柜</span><em></em></li>
             <li><span>常用网址</span><em></em></li>
             <li><span>会议安排</span><em></em></li>
           </ul>          
        </div>
        <div class="OA_main_mapTop3"></div>
        
        <div class="OA_mian_mapContent">
           <ul class="log">
             <volist name="j_info" id="v">
             <li><img src="__PUBLIC__/Images/OA_main26.jpg" />&nbsp;<a href="__APP__/JobLog/look_jobLog/j_id/<{$v.j_id}>"><{$v.j_content|substr=0,25}>...</a></li>
             </volist>
           </ul>
           
           <ul class="file">
             <volist name="f_info" id="v">
             <if condition="$v.f_type eq 'exe'">
             <li><img src="__PUBLIC__/Images/OA_main28.jpg" />&nbsp;<a href="<{$v.f_path}><{$v.f_filename}>"><{$v.f_newname}></a></li>
             <elseif condition="($v.f_type eq 'jpg') or ($v.f_type eq 'png') or ($v.f_type eq 'gif')" />
             <li><img src="__PUBLIC__/Images/OA_main27.jpg" />&nbsp;<a href="<{$v.f_path}><{$v.f_filename}>"><{$v.f_newname|substr=0,30}>...</a></li>
             <else />
             <li><img src="__PUBLIC__/Images/OA_main29.jpg" />&nbsp;<a href="<{$v.f_path}><{$v.f_filename}>"><{$v.f_newname}></a></li>
             </if>
             </volist>
          </ul>
          
         <ul class="url" id="show_url">
             <volist name="u_info" id="v">
             <li class="_url" title="<{$v.u_url}>"><img src="__PUBLIC__/Images/OA_main30.jpg"/>&nbsp;<a href="<{$v.u_url}>" target="_top"><{$v.u_url|substr=0,28}></a><span style="float:right;margin-right:5px;cursor:pointer;display:inherit;color:green" class='update_url'>[更新]</span></li>
             </volist>
           </ul>
           
           <ul class="xxx">
             <volist name="meet_info" id="v">
             <li><img src="__PUBLIC__/Images/OA_main26.jpg" />&nbsp;<a href="#">主题:<{$v.m_title}> <a href="__APP__/Meeting/huiyi_info/m_id/<{$v.m_id}>"  >【查看详细】</a></a></li>
             </volist>
           </ul>
        </div>       
     </div>
     <else />
     <div class="OA_main_map S_6">
        <div class="OA_main_mapTop1"></div> 
        <div class="OA_main_mapTop2">
           <ul>
             <li><span>工作日志</span><em></em></li>
             <li><span>个人文件柜</span><em></em></li>
             <li><span>常用网址</span><em></em></li>
             <li><span>会议安排</span><em></em></li>
           </ul>          
        </div>
        <div class="OA_main_mapTop3"></div>
        
        <div class="OA_mian_mapContent">
           <ul class="log">
             <volist name="j_info" id="v">
             <li><img src="__PUBLIC__/Images/OA_main26.jpg" />&nbsp;<a href="__APP__/JobLog/look_jobLog/j_id/<{$v.j_id}>"><{$v.j_content|substr=0,25}>...</a></li>
             </volist>
           </ul>
           
           <ul class="file">
             <volist name="f_info" id="v">
             <if condition="$v.f_type eq 'exe'">
             <li><img src="__PUBLIC__/Images/OA_main28.jpg" />&nbsp;<a href="<{$v.f_path}><{$v.f_filename}>"><{$v.f_newname}></a></li>
             <elseif condition="($v.f_type eq 'jpg') or ($v.f_type eq 'png') or ($v.f_type eq 'gif')" />
             <li><img src="__PUBLIC__/Images/OA_main27.jpg" />&nbsp;<a href="<{$v.f_path}><{$v.f_filename}>"><{$v.f_newname|substr=0,30}>...</a></li>
             <else />
             <li><img src="__PUBLIC__/Images/OA_main29.jpg" />&nbsp;<a href="<{$v.f_path}><{$v.f_filename}>"><{$v.f_newname}></a></li>
             </if>
             </volist>
          </ul>
          
         <ul class="url" id="show_url">
             <volist name="u_info" id="v">
             <li class="_url" title="<{$v.u_url}>"><img src="__PUBLIC__/Images/OA_main30.jpg"/>&nbsp;<a href="<{$v.u_url}>" target="_top"><{$v.u_url|substr=0,28}></a><span style="float:right;margin-right:5px;cursor:pointer;display:inherit;color:green" class='update_url'>[更新]</span></li>
             </volist>
           </ul>
           
           <ul class="xxx">
             <volist name="meet_info" id="v">
             <li><img src="__PUBLIC__/Images/OA_main26.jpg" />&nbsp;<a href="#">主题:<{$v.m_title}> <a href="__APP__/Meeting/huiyi_info/m_id/<{$v.m_id}>"  >【查看详细】</a></a></li>
             </volist>
           </ul>
        </div>       
     </div>
     </if>
     <!--网站地图版块结束-->
     
     <div class="OA_footer">
         <p>公司名称:<{$company_info[0]['c_cname']}> 公司电话:<{$company_info[0]['c_cphone']}></p>
     </div>
  </div>
 
 <div id="pop" style="display:none;"> 
  <div id="popHead">
	<a id="popClose" title="关闭">关闭</a>
	<h2>公司紧急通告</h2>
	</div>
	<div id="popContent">
	<dl>
		<dt id="popTitle"><a href="#" target="_blank">这里是参数</a></dt>
		<dd id="popIntro">这里是内容简介</dd>
	</dl>
	<!--<p id="popMore"><a href="#" target="_blank">查看 »</a></p>-->
	</div>
  </div>
 </div>
</body>
  <script type="text/javascript" >
	  //记得加载jquery
	  //使用参数：1.标题，2.链接地址，3.内容简介
	  window.onload=function(){
			var pop=new Pop("<{$jinji_info['j_title']}>",
			"",
			"<{$jinji_info['j_content']}>");
	  }
	  
	 
	 
	  
	  //日历程序部
	var now_time = $("#time_info").text(); //获取当前年月
	
	//获取到当前系统时间，并组合成年-月-日的格式
	var now_date = new Date();
	var d_year = now_date.getFullYear();
	var d_month = (now_date.getMonth()+1);
	var d_day = now_date.getDate();
	if(d_month < 10){
	   d_month = "0"+d_month;	
	}
	var d_date = d_year+"-"+d_month+"-"+d_day;
	
	var time_arr = now_time.split("-");
	var new_month = time_arr[1];
	month_day(new_month,now_time); //调用函数计算月份天数并显示在前台
	
	//页面加载完成后模拟点击 当前日期的LI元素
	$(".OA_main_C2").find("li>a[title='"+d_date+"']").trigger("click");
	
	var new_year  = time_arr[0];
	var new_time;
	var lis = "";
	$(".button_1").click(function(){	
	    $(".OA_main_C2").html("");
		new_month = (new_month-1);
		if(new_month < 1){
		   new_month = 1;
		   alert("对不起,只能对当前年份进行备忘录的添加");
		}
		if(new_month < 10){
		   new_month = "0"+new_month;	
		}
		
		new_time = new_year+"-"+new_month;
		month_day(new_month,new_time); //调用函数计算月份天数并显示在前台
	    $("#time_info").text(new_time);
	});
	
	$(".button_2").click(function(){
		$(".OA_main_C2").html("");
		new_month = parseInt(new_month);
		new_month = (new_month+1);
		if(new_month > 12){
		   new_month = 12;	
		   alert("对不起,只能对当前年份进行备忘录的添加");
		}
		if(new_month < 10){
		   new_month = "0"+new_month;	
		}				
		new_time = new_year+"-"+new_month;
		month_day(new_month,new_time); //调用函数计算月份天数并显示在前台
	    $("#time_info").text(new_time);
	});
	
	
	//计算月份中的天数 并创建相应元素
	function month_day(month,time){
		month = parseInt(month);
	   	switch(month){
		    case 1:
			case 3:
			case 5:
			case 7:
			case 8:
			case 10:
			case 12:
			  for(var i=1;i<=31;i++){
				$(".OA_main_C2").append($("<li><a href='#' title='"+time+"-"+i+"'>"+i+"</a></li>"));
			  }			  
			break;
			case 4:
			case 6:
			case 9:
			case 11:
			  for(var i=1;i<=30;i++){
				$(".OA_main_C2").append($("<li><a href='#' title='"+time+"-"+i+"'>"+i+"</a></li>"));
			  }	
			break;
			case 2:
			  for(var i=1;i<=28;i++){
				$(".OA_main_C2").append($("<li><a href='#' title='"+time+"-"+i+"'>"+i+"</a></li>"));
			  }	
			break;     	
		}
				
		$(".OA_main_C2").find("li >a ").click(function(){
			 $(".OA_main_C2").find("li >a ").removeClass("hover_lis");
			 $(this).addClass("hover_lis");
		     title = $(this).attr("title");
			 //获取当前项目的目录
			 $.get("__URL__/main_ajax",{
				  nowTimes : title
			 },function(data){
				  var msg = $("<font color=green>"+data+"</font>")
				  $("#memo_msg").html(msg);
			 });
	    });
		
	}
	
	
	//点击当天按钮处理
		$("#d_click").click(function(){
			 $(".OA_main_C2").find("li>a[title='"+d_date+"']").trigger("click");
		});
		
    //添加备忘录
	$("#add_memo").click(function(){
		var v = $("#memo_value").val();
		if(v==""){
		   alert("对不起,请添加备忘内容");	
		}

		$.get("__URL__/add_memo",{
			  value : v,
			  d_times : title
		},function(data){
			  if(data==1){
				 alert("备忘录添加成功");
				 $("#memo_value").val("");  				 
			  }else if(data==2){
				 alert("备忘录添加失败");  
			  }else{
				 alert("对不起,您当天已经添加过备忘录了");  
			  }
		});
	});
	
	//双击修改备忘录
	var memo_i = 0; //禁止重复添加更新内容框
	$("#memo_msg").dblclick(function(){
		if(memo_i == 0){
			$(this).append("<textarea cols=30 rows=4 id='update_memo' style='border:1px solid #f0f0f0;'></textarea>");
			    memo_i = 1; 
		    $("#update_memo").focus();
	    }
		
		//焦点离开时保存信息
		$("#update_memo").blur(function(){
			if(this.value==""){
			      location.reload();
			}else{		
		    	  var update_v = $(this).val();
				  $.get("__URL__/update_memo",{
				 	value : update_v,
			     	d_times : title
				  },function(data){
					  if(data==1){
				 	     alert("备忘录信息更新成功");
				 	     location.reload();
			    	  }else{
				 	     alert("备忘录更新失败");  
			    	  }
				 });
			}
	    });
	});
	
	//常用网址设置
	var url_i = 0;
	$(".update_url").click(function(){
		var url_title = $(this).parent().attr("title");
		var index = ($(".update_url").index(this)+1);
		if(url_i == 0){
		$(this).prev().remove();
		$(this).parent().append("&nbsp;<input type='text' style='width:140px;height:25px;border:1px solid #ccc;' id='url_value' value="+url_title+">");
		   $("#url_value").focus();
		   url_i = 1;
		}
		
		$("#url_value").blur(function(){
			var url_value = $("#url_value").val();
			$.get("__URL__/add_url",{
				 u_number : index,
				 u_url : url_value
			},function(data){
				if(data==1){
				   alert("网址添加成功");
				   location.reload();
				}else{
				   alert("网址添加失败");	
				}
			});
		});
	});
	
	 //拖动JS 
	 <if condition="$user_info[0]['u_window'] eq '1'">
	   <volist name="section_info" id="v">
         make_draggable($('.S_'+<{$v.s_id}>),<{$v.s_id}>); 
	   </volist>
	 </if>
	   var zIndex = 0;

       function make_draggable(elements,sectionID){   
      	  elements.draggable({   
        	opacity: 0.8,   
        	containment:'document.body',   
       	    start:function(e,ui){ ui.helper.css('z-index',++zIndex);},   
        	stop:function(e,ui){ 

               $.get('__URL__/save_absolute',{   
                  x        : ui.position.left,   
                  y        : ui.position.top,   
                  z        : zIndex, 
				  sid      : sectionID 
               },function(data){
				  if(data!=1){
					 alert('个人办公桌位置保存失败~。~！');    
				  }
			   }); 
        	}   
          })  
	   }
	   
</script>
</html>